<?php Yii::app()->clientScript->registerScriptFile (Yii::app()->baseUrl.'/js/number/jquery.autotab-1.1b.js'); ?>
<div class="bg_tt_page">
	<div class="my">My Account</div>
	<div class="ac">Speed Dialing</div>
</div>
<div class="center_page_afterlogin">
	<div class="col_left">
    <?php $this->renderPartial('//common/leftCustomer'); ?>
    </div>
    <div class="col_right">    	
    	<div class=" p13l p12t p13b p10r">
			<!-- EDIT + DELETE SPEEDDIAL-->
    		<div class="box_phonenumber">
    			<?php 
					$this->widget('ext.MListView', array(
					    'dataProvider'  => $dataProvider,
						'table_header'  => '<table width="100%" border="0" cellspacing="0" cellpadding="0">
						  					<tr class="bg_table">
											    <td class="boder_right" width="20%"><strong>Speed Dial #</strong></td>
											    <td class="boder_right" width="18%"><strong>Destination Tel #</strong></td>
											    <td class="boder_right" width="17%"><strong>Description</strong></td>
											    <td colspan="2" align="center"><strong>Action</strong></td>
						    				</tr>',
						'table_footer'  => '</tbody></table>',
					    'itemView'      => '_viewSpeedDial',
						'template'      => "{items}\n{pager}",
						'pagerCssClass' => 'pag',
						'pager' => array(
							'cssFile'       => Yii::app()->baseUrl.'/css/mypager.css',
							'header'        => '',
							'firstPageLabel'=>'<<',
							'prevPageLabel' =>'<img src="images/bule_prev.png" />',
							'nextPageLabel' =>'<img src="images/bule_next.png" />',	
							'lastPageLabel' =>'>>',
						),
					) );
				?>
            </div><!-- #box_phonenumber -->
            <!-- #EDIT + DELETE SPEEDDIAL-->
        </div>
        
        <!-- ADD SPEEDDIAL-->
		<div class="box_makepayment ">
			<?php $form = $this->beginWidget('CActiveForm', array(
				'id' => 'speeddial-form',
			)); ?>     
		    <label>Speed Dial No.: </label>
		    <?php echo $form->dropDownList($model, 'F_PARM', CGlobal::$listSpeedDial, array('class' => 'w110 float_left')); ?>
		    <br class="cb" />
		    
		    <label>Destination No:</label>
		    <?php echo $form->dropDownList($model, 'country_code', CHtml::listData(SUBFEATUREPARM::getCountry(),'Country', 'CountryCode'), array('class' => 'w110 float_left')); ?>
		    
		    <?php 
		    	$form->textField($model, 'phone_number', array('class' => 'box_makepayment_txt w208 float_left', 'id' => 'phone_number'));	
		    ?>
		    <?php 
		    $script = <<<SCRIPT
			    jQuery(function(){
	    			watermark(document.getElementById('phone_number'));
		    	});
		    	
		    	jQuery('#phone_number').autotab_magic().autotab_filter('numeric');
SCRIPT;
		    Yii::app()->clientScript->registerScript('myscript', $script, CClientScript::POS_READY); ?>
		    <br class="cb" />
		    		       
		    <div class="p190l p5t p10b">
		    <?php if($isUpdate): ?>
		    	<?php echo CHtml::link('Update', '#',array('submit' => array(''),'params' => array('UpdateSpeedDialForm' => true, 'id' => $model->F_PARM,),'class' => 'bt_submit float_left', ));?>
		    	<?php echo CHtml::link('Cancel', array('customer/speedDial', 'lang' => $this->language), array('class' => 'bt_submit m10l float_left', ));?>
			<?php else: ?>
				<?php echo CHtml::link('Add', '#',array('submit' => array(''),'class' => 'bt_submit', ));?>
			<?php endif; ?>
		    </div>
		    <br class="cb" />

		    <?php echo $form->errorSummary($model); ?>
		    <div class="bo_b_t p10t"><span class="ogr_color">Note:</span> To use the speed dialing function, please call our tool-free or local access number. After you hear available credit, please press the "#" key, then the speed dialing number and press the "#" again, for example "#2#".</div>
		    <?php $this->endWidget(); ?>
		 </div><!-- #box_makepayment -->

		 <!-- #ADD SPEEDDIAL-->
		 <!-- MESSAGE -->
    		<?php if(Yii::app()->user->hasFlash('speeddial-success')): ?>
				<div class="flash-success">
					<?php echo Yii::app()->user->getFlash('speeddial-success'); ?>
				</div>
			<?php endif; ?>

			<?php if(Yii::app()->user->hasFlash('speeddial-error')): ?>
				<div class="flash-error">
					<?php echo Yii::app()->user->getFlash('speeddial-error'); ?>
				</div>
			<?php endif; ?>

			<?php if(Yii::app()->user->hasFlash('speeddial-notice')): ?>
				<div class="flash-notice">
					<?php echo Yii::app()->user->getFlash('speeddial-notice'); ?>
				</div>
			<?php endif; ?>

			<?php
			    Yii::app()->clientScript->registerScript(
			       'myHideEffect',
			       '$(".flash-success").animate({opacity: 1.0}, 3000).fadeOut("slow");
			       	$(".flash-error").animate({opacity: 1.0}, 3000).fadeOut("slow");
			       	$(".flash-notice").animate({opacity: 1.0}, 3000).fadeOut("slow");
			       ',
			       CClientScript::POS_READY
			    );
			?>
			<!-- #MESSAGE -->
    </div>
    <div class="cb"></div>
</div>
<div class="bottom_pages_afterlogin"></div>   